package cn.kgc.tangcco.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author 李昊哲
 * @Description 用户类
 * @date 2020/12/10 下午1:50
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Account {
    /**
     * 用户id
     */
    private long id;
    /**
     * 手机号
     */
    private String mobile;
    /**
     * 姓名
     */
    private String nickname;
    /**
     * 积分
     */
    private long integral;
    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private Date createTime;

    public Account(String mobile, String nickname, long integral) {
        this.mobile = mobile;
        this.nickname = nickname;
        this.integral = integral;
    }
}
